package cn.hairui.blog.service.impl;

import cn.hairui.blog.model.Topic;
import cn.hairui.blog.repository.TopicRepository;
import cn.hairui.blog.service.TopicService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * @author lihairui
 * @version V1.0
 * @date: 2019/7/28 21:26
 */
@Service(value = "topicService")
public class TopicServiceImpl implements TopicService {

    @Autowired
    private TopicRepository topicRepository;

    @Override
    public List<Topic> findLimited(int count) {
        return topicRepository.findLimited(count);
    }

    @Override
    public List<Topic> list() {
        return topicRepository.list();
    }

    @Override
    public Topic find(int id) {
        return topicRepository.find(id);
    }

    @Override
    public List<Map> listMgr() {
        return topicRepository.listMgr();
    }

    @Override
    public int add(Topic topic) {
        return topicRepository.add(topic);
    }

    @Override
    public void update(Topic topic) {
        topicRepository.update(topic);
    }

    @Override
    public void delete(int id) {
        topicRepository.delete(id);
    }

    @Override
    public List<Map> findCountList() {
        return topicRepository.findCountList();
    }
}
